import request from '@/utils/request';

// 查询团购规则列表
export function listRules(query) {
	return request({
		url: '/mall/rules/list',
		method: 'post',
		data: query,
	});
}

// 查询团购规则详细
export function getRules(id) {
	return request({
		url: '/mall/rules/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增团购规则
export function addRules(data) {
	return request({
		url: '/mall/rules/add',
		method: 'post',
		data: data,
	});
}

// 编辑团购规则
export function updateRules(data) {
	return request({
		url: '/mall/rules/edit',
		method: 'post',
		data: data,
	});
}

// 删除团购规则
export function delRules(id) {
	return request({
		url: '/mall/rules/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出团购规则
export function exportRules(query) {
	return request({
		url: '/mall/rules/export',
		method: 'post',
		params: query,
	});
}
